//用来配置路由
import Home from "../views/Home.vue"
import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router' // 引入路由模块

// 路由配置表
const routes = [
    {
        path: '/home', //路由的路径url
        name: 'home', // 路由的名字
        component: Home, // 路由对应的组件 views里面的vue页面
        // show: true, 路由是否可见 菜单是否加载首页名字，默认是true
        //usefrom 是否是全屏展示，默认是false 是不全屏

        meta: { title: '首页', show: true, icon:'HomeFilled',usefrom:false}
    },
    {
        path: '/moveshop',
        name: 'moveshop',
        component: () => import('../views/MoveShop.vue'),
        meta: { title: '移动端首页', show: true, icon: 'Iphone', usefrom: true }
    },
    {
        path: '/movedetail',
        name: 'movedetail',
        component: () => import('../views/Movedetail.vue'),
        meta: { title: '商品详情', show: true, icon: 'Iphone', usefrom: true }
    },
    {
        path: '/product',
        name: 'product',
        component: () => import('../views/product/Index.vue'),
        meta: { title: '商品管理', show: true, icon: 'Memo' },
        children: [
            {
                path: '/product/list',
                name: 'productList',
                component: () => import('../views/product/List.vue'),
                meta: { title: '商品列表', show: true, icon: 'List' }

            }
        ]
    }
]
//创建路由实例
const router = createRouter({
    history: createWebHistory(), // 路由的模式
    routes // 路由配置表


})

//导出路由
export default router;
